From: Florian Müllner Date: Tue, 4 Oct 2011 23:18:16 +0000 (+0200) Subject: texture-cache: Don't share requests for uncachable textures X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~1013^2^2~7491 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=23a4d4c69e071030197f2aaea913d4cd742c48c9;p=gnome-shell.git texture-cache: Don't share requests for uncachable textures Make create_texture_and_ensure_request() aware of the caching policy to avoid returning the same texture for different images. https://bugzilla.gnome.org/show_bug.cgi?id=660585 --- diff --git a/src/st/st-texture-cache.c b/src/st/st-texture-cache.c index 1e83a0dea..040165001 100644 --- a/src/st/st-texture-cache.c +++ b/src/st/st-texture-cache.c @@ -1115,6 +1115,7 @@ st_texture_cache_load (StTextureCache *cache, * @cache: * @key: A cache key * @size: Size in pixels + * @policy: Cache policy * @request: (out): If no request is outstanding, one will be created and returned here * @texture: (out): A new texture, also added to the request * @@ -1128,6 +1129,7 @@ static gboolean create_texture_and_ensure_request (StTextureCache *cache, const char *key, guint size, + StTextureCachePolicy policy, AsyncTextureLoadData **request, ClutterActor **texture) { @@ -1154,7 +1156,8 @@ create_texture_and_ensure_request (StTextureCache *cache, { /* Not cached and no pending request, create it */ *request = g_new0 (AsyncTextureLoadData, 1); - g_hash_table_insert (cache->priv->outstanding_requests, g_strdup (key), *request); + if (policy != ST_TEXTURE_CACHE_POLICY_NONE) + g_hash_table_insert (cache->priv->outstanding_requests, g_strdup (key), *request); } else *request = pending; @@ -1203,7 +1206,7 @@ load_gicon_with_colors (StTextureCache *cache, } g_free (gicon_string); - if (create_texture_and_ensure_request (cache, key, size, &request, &texture)) + if (create_texture_and_ensure_request (cache, key, size, policy, &request, &texture)) { g_free (key); return texture;